package com.zrfintech.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zrfintech.common.pojo.BasePageEntity;
import com.zrfintech.domain.MgUser;
import org.springframework.stereotype.Service;
@Service
public class MgUserRepo extends MgUserRepoI {
    public MgUser getByUserCodeAndPassword(String userCode, String password) {
        QueryWrapper<MgUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq(USER_CODE_COLUMN, userCode);
        queryWrapper.eq(USER_PASSWORD_COLUMN, password);
        return dao.selectOne(queryWrapper);
    }

    public Page<MgUser> pageList(BasePageEntity basePageEntity) {
        Page<MgUser> rowPage = new Page(basePageEntity.getPage(), basePageEntity.getPerPage());
        return dao.selectPage(rowPage, null);
    }
}
